<?php /* Created on: 5/6/2010 */ ?>

<?php
  include "connect_flag.php";
 /*  
  $waterselect = $_REQUEST['waterselect']; 
  $ammon = $_REQUEST['ammon'];
  $ph = $_REQUEST['ph'];
  $temp = $_REQUEST['temp'];
  $nitrate = $_REQUEST['nitrate'];
 */

 $sql="INSERT INTO $waterselect (id, time, temp, ammonia, ph, nitrate)
VALUES
('', CURDATE(), '$temp', '$ammon', '$ph', '$nitrate' )";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "1 record added";
 
mysql_close($con);
$url = $_SERVER['HTTP_REFERER']; 
echo '<meta http-equiv="refresh" content="1;URL=' . $url . '">';   
?>

